<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="com.pengtu.security.SpringSecurityUtils"%>
<%@ include file="/common/taglibs.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="menu" content="assetMenu" />
<meta name="nav" content="1" />
<meta name="acc" content="0" />
<title>收文档案</title>
<script>
	function changeSigner(param) {
		var url = "<c:url value='/account/json/userchooses.action'/>";
		var obj = new Object();
		mm = window
				.showModalDialog(
						url,
						obj,
						'dialogHeight:400px;dialogWidth:600px;status:no;toolbar:no;resizable:no;menubar:no;location:no;scrollbars:no;dialogLeft:'
								+ (screen.width / 2.0 - 150) + ',dialogTop:170')
		if (mm != null) {
			if (param == 1) {
				$("input[name='recipient']").val(mm);
			} else if (param == 2) {
				$("input[name='approved']").val(mm);
			} else if (param == 3) {
				$("input[name='undertake']").val(mm);
			}
		}
	}

	function changeDepName() {
		var url = "<c:url value='/account/api/department.action'/>";
		var obj = new Object();
		mm = window
				.showModalDialog(
						url,
						obj,
						'dialogHeight:500px;dialogWidth:780px;status:no;toolbar:no;resizable:no;menubar:no;location:no;scrollbars:no;dialogLeft:'
								+ (screen.width / 2.0 - 150) + ',dialogTop:170')
		if (mm != null) {
			$("input[name='department.id']").val(mm.id);
			$("input[name='department.depName']").val(mm.depName);
		}
	}
</script>
</head>
<body>
	<h2>
		<s:if test="id == null">创建</s:if>
		<s:else>修改</s:else>
		收文档案
	</h2>
	<form action="received_arc!save.action" method="post" class="yform"
		id="mainForm">
		<input type="hidden" name="id" value="${id }" />
		<table class="noborder">
			<tr class="type-text">
				<td>来文标题</td>
				<td><input type="text" name="title" value="${title }"/></td>
			</tr>
			<tr class="type-text">
				<td>来文部门</td>
				<td><input type="hidden" name="department.id"
					value="${department.id}" /> <input type="text"
					name="department.depName" value="${department.depName }" />
					<div class="type-button">
						<input type="button" onclick="changeDepName()">
					</div></td>
			</tr>
			<tr class="type-text">
				<td>签收人</td>
				<td><input type="text" name="recipient" value="${recipient }" /><input
					type="button" onclick="changeSigner(1)" value="选择" /></td>
			</tr>
			<tr class="type-text">
				<td>批办人</td>
				<td><input type="text" name="approved" value="${approved }" /><input
					type="button" onclick="changeSigner(2)" value="选择" />
				</td>
			</tr>
			<tr class="type-text">
				<td>承办人</td>
				<td><input type="text" name="undertake" value="${undertake }" /><input
					type="button" onclick="changeSigner(3)" value="选择" /></td>
			</tr>
			<tr class="type-text">
				<td>备注</td>
				<td><textarea rows="" cols="" name="remark">${remark }</textarea>
				</td>
			</tr>
			<tr class="type-text">
				<td>附件</td>
				<td><input type="file" name="annex" value="${annex}" /></td>
			</tr>
			<tr>
				<td colspan="2">
					<div class="type-button">
						<security:authorize ifAnyGranted="ROLE_修改用户">
							<input   type="submit" class="submit" value="保存" />&nbsp;
					</security:authorize>
						<input   type="button" value="返回" class="reset"
							onclick="history.back()" />
					</div>
				</td>
			</tr>
		</table>
	</form>
</body>
</html>